﻿/* Armor.cs
 * Author: Richard Broker
 * 
 *  This file is part of Tame.
 *
 *  Tame is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  Tame is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with Tame. If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Tame
{
    class Armor
    {

        public string convertArmorNameToType(string armor_Name)
        {
            string armorType = "";

            switch (armor_Name)
            {
                case ":: None ::":
                case "":
                case "Conventional:":
                case "Organic:":
                case "Pardus:":
                    armorType = "";
                    break;


                case "Titanium (x1)":
                case "Tritanium (x2)":
                case "Zortrium (x3)":
                case "Neutronium (x4)":
                case "Adamantium (x5)":
                case "Ebidium (x6)":
                armorType = "Conventional";
                    break;

                case "Worm-Slime (x2)":
                case "Mykoplasmic (x3)":
                case "Mutagen (x4)":
                case "Genotrope (x5)":
                    armorType = "Organic";
                    break;

                case "Electro-Magnetic:":
                case "Fermion (x2)":
                case "Boson (x3)":
                case "Positron (x4)":
                case "Anti-Neutrino (x5)":
                    armorType = "Electro-Magnetic";
                    break;

                case "Pardus I":
                case "Pardus II":
                case "Pardus III":
                case "Pardus IV":
                case "Pardus V":
                case "Pardus VI":
                    armorType = "Pardus";
                    break;
            }
            return armorType;
        }

        public int convertArmorNameToStrength(string armor_Name)
        {
            int armorStrength = 0;
            armor_Name = Regex.Replace(armor_Name, "[^0-9]", "");
            
            try
            {
                armorStrength = int.Parse(armor_Name);
                return armorStrength;
            }
            catch (Exception)
            {
                return -1; // Error;
            }
            
        }

               
    }
}
